package test.bytes;

import java.io.UnsupportedEncodingException;

import org.junit.Test;

public class StringChat {
	/**
	 * new String 和String.getbytes,的编码都是默认跟随这编译环境(编译器和系统)
	 * @throws UnsupportedEncodingException
	 */
	@Test
	public void test() throws UnsupportedEncodingException {
		String str = "你好";
		byte[] bytes = str.getBytes("gbk");
		System.out.println(new String(bytes));
	}
}
